package dome3;

public class Student implements Comparable{
    private String name;
    private double score;

    public Student(String name, double score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Object o) {
            Student student = (Student) o;
            if(this.score > student.score) {
                return 1;
            }else if(this.score <student.score) {
                return -1;
            }else {
                return 0;
        }
    }
}
